#############################
# Dino P. Christenson and David M. Glick
# Boston University
# Replication data and code for: 
# "Chief Justice Roberts’ Health Care Decision Disrobed: The Microfoundations of the Supreme Court’s Legitimacy." American Journal of Political Science. 
# June 2014 
#############################

### load data 
# load("Legitimacy_Microfoundations_AJPS_Replication.RData")
hcdata<-read.csv("Legitimacy_Microfoundations_AJPS_Replication.csv", header=T)
objects()
names(hcdata)
attach(hcdata)

### legitimacy models 

# ideology x treatment interaction 
lmfit_both_inter = lm(legit_gain_W2W3 ~ 
	fct_cbsroberts_dd + ideol_dist_change_W2W3 + 		
	pid_rep_W1 + pid_ind_W1 + 
	sc_info_index_W2 + pol_trust_W1 + media_differential_W1 + 
	age_W1 + education_W1 + female_W1 + black_W1 + latino_W1 + 			
	fct_cbsroberts_dd:ideol_dist_change_W2W3)  
summary(lmfit_both_inter)

# change through wave 4 persistent effects 
lmfit_both_interlong = lm(legit_gain_W2W4 ~ 
	fct_cbsroberts_dd + ideol_dist_change_W2W3 + 		
	pid_rep_W1 + pid_ind_W1 + 
	sc_info_index_W2 + pol_trust_W1 + media_differential_W1 + 
	age_W1 + education_W1 + female_W1 + black_W1 + latino_W1 + 			
	fct_cbsroberts_dd:ideol_dist_change_W2W3)  
summary(lmfit_both_interlong)

# legality x treatment interaction 
lmfit_inter_legitxtrtmt = lm(legit_gain_W2W3 ~ 
	fct_cbsroberts_dd + ideol_dist_change_W2W3 + 		
	pid_rep_W1 + pid_ind_W1 + 
	sc_info_index_W2 + pol_trust_W1 + media_differential_W1 + 
	age_W1 + education_W1 + female_W1 + black_W1 + latino_W1 + 	
	fct_legit_proxy_W2 +		
	fct_legit_proxy_W2:fct_cbsroberts_dd)  
summary(lmfit_inter_legitxtrtmt)

# ideology x legality interaction 
lmfit_inter_legitxideol = lm(legit_gain_W2W3 ~ 
	fct_cbsroberts_dd + ideol_dist_change_W2W3 + 		
	pid_rep_W1 + pid_ind_W1 + 
	sc_info_index_W2 + pol_trust_W1 + media_differential_W1 + 
	age_W1 + education_W1 + female_W1 + black_W1 + latino_W1 + 	
	fct_legit_proxy_W2 +		
	fct_legit_proxy_W2:ideol_dist_change_W2W3)  
summary(lmfit_inter_legitxideol)




